////
//
/// \file ./include/inc/parser/inc/parser/vector_type_node.hpp
//
//  Copyright 2007, 2008 Chandler Carruth
//
//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
//  use this file except in compliance with the License.  You may obtain a copy
//  of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
//  License for the specific language governing permissions and limitations
//  under the License.
//
////

#ifndef inc_parser_vector_type_node_header
#define inc_parser_vector_type_node_header

#include <string>

#include <boost/scoped_ptr.hpp>

#include <inc/parser/parse_tree_node.hpp>

namespace inc {
namespace parser {

class WSParser;
class ImmediateNode;
class AtomicTypeNode;

/// \brief Vector type parse node
/// \author Chandler Carruth
/// \date 2007.08.12
///
/// This parses the vector type node. Vectors represent a finite, constant, and
/// immediate sized array of atomic elements. This atomic element constraint
/// makes vectors non-recursive, and more deterministically defined. It also
/// provides a clean mapping of vectors onto available hardware. Scalar
/// lowering of unsupported vectors is very well supported in modern compilers,
/// however vectorizing is quite difficult. This is where a programming
/// language steps in to bridge the gap by providing a convenient tool for the
/// programmer to describe vector operations.

class VectorTypeNode : public ParseTreeNode
{
public:
  VectorTypeNode();
  virtual ~VectorTypeNode();

  virtual bool parse( const iterator& first,
                      const iterator& last,
                      iterator& last_parsed );

  virtual ImmediateNode* get_size() const;
  virtual AtomicTypeNode* get_element_type() const;

private:
  boost::scoped_ptr<ImmediateNode> size;
  boost::scoped_ptr<AtomicTypeNode> element_type;

  boost::scoped_ptr<WSParser> ws;
};

} //  end parser namespace
} //  end inc namespace
#endif  //  inc_parser_vector_type_node_header
